home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
501-525
/
disk_519
/
avlsort
/
avlsort.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
3KB
|
110 lines
NAME
AVLSort - Sort a file.
SYNOPSIS
AVLSORT From To COLSTART/k WIDTH/k CASE/s REVERSE/s STRIP/s OPT/k
DESCRIPTION
AVLSort was written to remedy several defects of the ARP Sort
command. AVLSort places each line of text in an AVL tree, which has
reasonable worst-case performance, even for large files. I have not
made speed comparisons with AmigaDos Sort or with ARP Sort.
This program can handle large files, up to available memory. There
is no arbitrary limit on the number of lines in the file (I have
seen a report that ARP Sort is limited to 32767 lines).
The order of otherwise identical lines does not change in the output
file. This can happen in ARP Sort when using the COLSTART and WIDTH
switches.
If you omit the From argument from Sort, it reads from its standard
input, which allows it to be used in pipelines.
OPTIONS
From infile
Input file name. Default is stdin.
To outfile
Output file name. Default is stdout.
COLSTART n
This takes a numeric argument which gives the starting
column for the sort. All entries to the left of this column
will not be considered in the final arrangement. Default is
column 1.
WIDTH n
This takes a numeric argument, which gives the width for the
sort. Default is to use the entire line.
You can use this to specify a 'window' for Sort to work on.
For example, using a WIDTH of 4 will arrange a file based on
the first 4 characters of each line. If you also use
COLSTART, then the first 4 characters starting at that
column will be the ones on which the sort is based.
CASE
The CASE switch will use a case-sensitive match, rather than
the default case-insensitive match.
REVERSE
The REVERSE switch will cause the sorted file to be printed
in reverse order.
** This switch is not available with the AmigaDos or ARP
Sort commands.
STRIP
Strip trailing white space from input lines.
** This switch is not available with the AmigaDos or ARP
Sort commands.
TABSTOP n
Tabs in the input file will be expanded to blanks, with
tab stops every <n> columns.
** This switch is not available with the AmigaDos or ARP
Sort commands.
OPT T|C|R|S
Same as TABSTOP 8 | CASE | REVERSE | STRIP.
** This switch is not available with the AmigaDos or ARP
Sort commands.
EXAMPLE
list >listfile
avlsort listfile colstart 41
or using pipes: list | avlsort colstart 41
This gives a listing of all files sorted by time (i.e., from the
earliest to the latest).
BUGS
File size is limited by available memory.
SEE ALSO
ARP Sort
AUTHOR
Robert L. Pyron
CREDITS
The AVL tree package was written by Mark E. Mallett of Zinn Computer
Company, copyright 1988.
The startup code is by Sebastiano Vigna, based on previous work by
Scott Ballantine and John Toebes.
Much of this document (AVLSORT.DOC) was lifted from the ARP
documentation for Sort.